package com.spring.api.web.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.spring.api.web.dao.SmsSendHistoryMapper;
import com.spring.api.web.model.SmsSendHistory;
import com.spring.api.web.service.SmsSendHistoryService;
import com.spring.security.web.model.BaseResult;

@Service
public class SmsSendHistoryServiceImpl implements SmsSendHistoryService {

	@Resource SmsSendHistoryMapper smsSendHistoryMapper;
	
	@Override
	public BaseResult deleteByPrimaryKey(String id) {
		BaseResult ret = new BaseResult();
		int isSuc = smsSendHistoryMapper.deleteByPrimaryKey(id);
		if(isSuc==0){
			ret.setStatus("0").setMsg("删除失败");
		}else{
			ret.setMsg("删除成功");
		}
		return ret;
	}

	@Override
	public BaseResult insert(SmsSendHistory record) {
		BaseResult ret = new BaseResult();
		int isSuc = smsSendHistoryMapper.insert(record);
		if(isSuc==0){
			ret.setStatus("0").setMsg("保存失败");
		}else{
			ret.setMsg("保存成功");
		}
		return ret;
	}
	
	@Override
	public BaseResult insertByList(List<SmsSendHistory> record){
		BaseResult ret = new BaseResult();
		int isSuc = smsSendHistoryMapper.insertByList(record);
		if(isSuc==0){
			ret.setStatus("0").setMsg("保存失败");
		}else{
			ret.setMsg("保存成功");
		}
		return ret;
	}

	@Override
	public SmsSendHistory selectByPrimaryKey(String id) {
		return smsSendHistoryMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<SmsSendHistory> selectByParm(SmsSendHistory parm) {
		return smsSendHistoryMapper.selectByParm(parm);
	}

	@Override
	public BaseResult updateByPrimaryKeySelective(SmsSendHistory record) {
		BaseResult ret = new BaseResult();
		int isSuc = smsSendHistoryMapper.updateByPrimaryKeySelective(record);
		if(isSuc==0){
			ret.setStatus("0").setMsg("更新失败");
		}else{
			ret.setMsg("更新成功");
		}
		return ret;
	}

}
